package com.xzp.ch06.anno;

import com.xzp.entity.User;
import org.apache.ibatis.annotations.Many;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;


import java.util.List;

public interface UserAndItemsMapper {
   @Select("select * from user u,items i,orderdetail o where u.id=o.userid and i.id=o.itemsid and u.id=#{id}")

@Results({
        @Result( id = true, column="id", property="id"),
        @Result(column="id",property="orderList",javaType = List.class,
        many = @Many(select = "com.xzp.ch06.anno.OrdersAndDetailMapper.selectOrdersAndDetailByUid")



        ),



})


public User selectUsersAndItems(Integer uid);

}
